package com.itheima.demo;
//家电

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor

public class JD implements Switch{  //(第三步)用接口后,alt+回车重写接口内的方法.该接口可共享给子类
    private String name;

    //状态:开或关
    private boolean status; //默认false是关

    @Override
    public void press() {
        //控制当前设备的开和关
        status=!status;
    }
}
